﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="TestPlate.cs" company="">
//   
// </copyright>
// <summary>
//   The test plate.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace FrontalMethod
{
    using System;
    using System.Windows.Forms;

    /// <summary>
    /// The test plate.
    /// </summary>
    public partial class TestPlate : Form
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="TestPlate"/> class.
        /// </summary>
        public TestPlate()
        {
            this.InitializeComponent();
        }

        /// <summary>
        /// The text box 3_ text changed.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="e">
        /// The e.
        /// </param>
        private void textBox3_TextChanged(object sender, EventArgs e)
        {
            string text = string.Empty;
            for (int i = 0; i < this.textBox3.Text.Length - 1; i++)
            {
                text += this.textBox3.Text[i];
            }

            if (this.textBox3.Text.Length >= 1)
            {
                if (
                    !((this.textBox3.Text[this.textBox3.Text.Length - 1] >= '0') &&
                      (this.textBox3.Text[this.textBox3.Text.Length - 1] <= '9')) &&
                    (!(this.textBox3.Text[this.textBox3.Text.Length - 1] == '.')))
                {
                    this.textBox3.Text = text;
                }
            }
        }
    }
}